<?php
	function show_db_errorxx(){
	exit('系统访问量大，请稍等添加数据');
    }

	//错误码定义
	$GLOBALS['0'] = 'success';
	$GLOBALS['90010'] = 'db connect faild.';
	$GLOBALS['80010'] = 'userid error';
	$GLOBALS['80011'] = 'userid not exist';
	$GLOBALS['80012'] = 'userid disable';
	$GLOBALS['70010'] = 'param error';
    
    //操作成功 返回json
    function output_json_success($data){
 		$json=array();
		$json['code']=0;
		$json['msg']=$GLOBALS['0'];
    	$json['data']=$data;

    	return $json;
	}
    

	//操作不成功 返回错误码
	function output_json_fail($errorCode,$data){
    	$json=array();
		$json['code']=$errorCode;
    	$json['msg']=$GLOBALS[$errorCode];
    	$json['data']=$data;

    	return $json;
	}

?>